#include "btform.h"
#include "ui_btform.h"

btForm::btForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::btForm)
{
    ui->setupUi(this);
}

void btForm::seticon(QString btIcon, QString content, int mid)
{
    ui->btIcon->setPixmap(QPixmap(btIcon));
    ui->btText->setText(content);
    this->id = mid;
}

void btForm::mousePressEvent(QMouseEvent *event)
{
    (void)event;
    ui->btStyle->setStyleSheet("#btStyle{ background:rgb(30, 206,154);}*{color:#f6f6f6;}");
    emit click(this->id);
}

void btForm::clearBg()
{
    ui->btStyle->setStyleSheet("btStyle:hover{background:#d8d8d8;");
}

btForm::~btForm()
{
    delete ui;
}

int btForm::getId()
{
    return id;
}
